/* Copyright ©, 2022, ECARX (Hubei) Technology Co., Ltd. All rights reserved.
 *
 * NOTICE: This file contains information which is confidential and proprietary to ECARX
 * (Hubei) Technology Co., Ltd. and/or other developers. No license to any intellectual
 * property rights contained within this file is either granted or implied except as may be
 * provided in an agreement with ECARX (Hubei) Technology Co., Ltd.
 *
 * Any unauthorized copying or distribution of content from this file in whole or in part
 * is prohibited.
 */
#ifndef ECARX_VHAL_CORE_PERSIST_PLATFORM_PROFILE_H
#define ECARX_VHAL_CORE_PERSIST_PLATFORM_PROFILE_H

#include "Profile.h"
namespace ecarx::vhal::core::persist {

/**
 * @brief ProfileListener interface
 * 
 */
class ProfileListener {
    public:
    virtual ~ProfileListener() {}
    virtual void onSwitchProfile(Profile* lastProfile, Profile* currentProfile) = 0;
};

/**
 * @brief Platform Profile interface
 * 
 */
class PlatformProfile {
  public:
    virtual ~PlatformProfile() {}
    virtual void onInit() = 0;
    virtual Profile* getCurrentProfile() = 0;
    virtual void addProfileListener(ProfileListener* listener) = 0;
    virtual void removeProfileListener(ProfileListener* listener) = 0;
    virtual std::shared_ptr<ProfileAuxiliary> getAuxiliary() = 0;
    virtual std::vector<int32_t> getCreatedProfileIds() = 0;
    virtual bool createProfile(int32_t newProfileId, int32_t cloneProfileId = 0) = 0;
    virtual bool isCreated(int32_t profileId) = 0;
    virtual bool deleteProfile(int32_t profileId) = 0;
    virtual bool activeProfile(int32_t profileId) = 0;
    virtual bool deleteCurrentProfilePreference(int32_t perferenceId) = 0;
    virtual bool activeCurrentProfilePreference(int32_t perferenceId) = 0;
};

}  // namespace ecarx::vhal::core::persist

#endif